SHELL := /bin/bash

# Set the environment variable BUILD_WITH_CONTAINER to use a container
# to build the repo. The only dependencies in this mode are to have make and
# docker. If you'd rather build with a local tool chain instead, you'll need to
# figure out all the tools you need in your environment to make that work.
export BUILD_WITH_CONTAINER ?= 0

# ifeq ($(BUILD_WITH_CONTAINER),1)

export

export GOBIN ?= $(GOPATH)/bin
export VERSION ?= 0.3-dev3
export IMAGE ?= regdev.99bill.com/yhf/ycontroller

export GO111MODULE ?= on
export GOPROXY ?= https://goproxy.cn,direct
export GOSUMDB ?= sum.golang.org


$(shell mkdir -p out)
build:
	go build -o out/ycontroller main.go
dockerbuild:
	docker build -t $(IMAGE):$(VERSION) .
dockerpush:
	docker push $(IMAGE):$(VERSION)

docker: build dockerbuild dockerpush
